/**
 * Created by Liu.Jun on 2020/4/30 17:13.
 */

import genImgItem from '../_commonConfig/ui/genImgItem';

export default {
    imgList: {
        'ui:options': {
            title: '添加图片',
            description: '图片宽度1920px，高度固定500px。<span>这里使用默认的field和校验提示</span>',
            showIndexNumber: true
        },
        items: {
            ...genImgItem({
                width: 1920,
                height: 500
            }),
            'ui:title': '轮播图片配置'
        }
    },
    inputText: {
        'ui:widget': () => Promise.resolve({
            name: 'TestAsyncWidget',
            content: '',
            props: {
                value: {
                    type: String,
                    default: ''
                },
                content: {
                    type: String,
                    default: ''
                }
            },
            render (h, context) {
                return h('div', {style: { padding: '4px', boxShadow: '0 0  4px 1px rgba(0,0,0,0.1)' }}, [
                    h('quill-theme-editor', {
                        props: {
                            type: 'text',
                            value: this.content
                        },
                        on: {
                            change: (event) => {
                                console.log(event);
                                this.$emit('input', event.html);
                            }
                        }
                    })
                ]);
            }
        })
    }
};
